from selenium.webdriver.common.by import By
from selenium import webdriver
import time
from Page1 import Page1

class Page2(Page1):
    sousuo_loc=(By.ID,'wd')
    def sousuo(self):
        self.send_keys(self.sousuo_loc,'五粮液')

    sousuobtn_loc = (By.XPATH, '/html/body/div[4]/div/div[2]/div[1]/form/input[2]')
    def sousuobtn(self):
        self.click(self.sousuobtn_loc)

    spxq_loc=(By.XPATH,'/html/body/div[6]/div/div[2]/div[5]/ul/li[1]/div[2]/div[1]/a/img')
    def spxq(self):
        self.click(self.spxq_loc)

    jiaru_loc=(By.ID,'addToCartForDetail')
    def jiaru(self):
        self.click(self.jiaru_loc)


    def luoji_jiuxiann(self):
        self.open_url('https://login.jiuxian.com/')
        self.sousuo()
        self.sousuobtn()
        time.sleep(5)
        self.spxq()
        self.jiaru()



